package com.ocpap.rest.serviceImpl;

import com.ocpap.rest.entity.Goods;
import com.ocpap.rest.mapper.GoodsMapper;
import com.ocpap.rest.service.WordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WordServiceImpl implements WordService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public int insert(Goods goods) {
        return goodsMapper.insertSelective( goods);
    }

    @Override
    public int update(Goods goods) {
        return goodsMapper.updateByPrimaryKeySelective(goods);
    }

    @Override
    public List<Goods> findAll(Goods goods) {
        return goodsMapper.findAll(goods);
    }

    @Override
    public Goods findById(Integer id) {
        return goodsMapper.selectByPrimaryKey(id);
    }

    @Override
    public  List<Goods>  findByName(String reName) {
        return goodsMapper.selectByName(reName);
    }


    @Override
    public int delete(Integer id) {
        return goodsMapper.delete(id);
    }
}
